package cn.shopifymall.studying.mybatis.controller;

import cn.shopifymall.studying.mybatis.entity.CompanyEntity;
import cn.shopifymall.studying.mybatis.entity.TenantEntity;
import cn.shopifymall.studying.mybatis.service.ComponyService;
import cn.shopifymall.studying.mybatis.service.TenantService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author 孤风雪影
 * @Email gitee.com/efairy520
 * @Date 2022/4/22 16:53
 * @Version 1.0
 */
@RestController
@RequestMapping("/dynamic")
public class DynamicController {

    @Autowired ComponyService componyService;

    @Autowired
    private TenantService TenantService;

    @GetMapping("/tenants")
    public List<TenantEntity> getAllTenants() {
        return TenantService.getAllTenantsFromFemix();
    }

    @GetMapping("/componys")
    public List<CompanyEntity> getAllComponys(){
        return componyService.getAllComponysFromFlow();
    }
}
